home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
softwareupdate
/
system
/
amigados
/
amigadoslibrary
/
fputs.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-10
|
767b
|
40 lines
/* FPuts.c V1.1 93-03-03 */
/* ROM library: "dos.library/FPuts", (V36+) */
/* Copyright 1993, Anders Bjerin, Amiga C Club */
#include <dos/dos.h>
#include <clib/dos_protos.h>
#include <stdio.h>
#include <stdlib.h>
UBYTE *version = "$VER: FPuts 1.1";
int main( int argc, char *argv[] );
int main( int argc, char *argv[] )
{
BPTR my_file;
int error_code;
/* Open a new file: */
my_file = Open( "RAM:Shakespeare.doc", MODE_NEWFILE );
if( !my_file )
exit( 20 );
/* Store a string: */
error_code = FPuts( my_file, "To be, or not to be..." );
/* OK? */
if( error_code == -1 )
printf( "Error while writing!\n" );
else
printf( "The string was successfully saved!\n" );
Close( my_file );
exit( 0 );
}